'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const F = require('../tinycolor/index.cjs'),
  g = new Array(10).fill(0),
  B = {
    red: '#F53F3F',
    orangered: '#FF702E',
    orange: '#FFA500',
    gold: '#FFBD14',
    yellow: '#FFE014',
    lime: '#A1E619',
    green: '#00B82B',
    cyan: '#0BD0D0',
    blue: '#2E8FFF',
    pqbblue: '#1A5EFF',
    purple: '#7126D9',
    magenta: '#FF299F',
  },
  b = {
    light: [
      '#F7F8F9',
      '#F2F3F4',
      '#E5E6E7',
      '#C9CACB',
      '#A9ABAC',
      '#868788',
      '#6B6C6D',
      '#4D4E4F',
      '#28292A',
      '#1E1F20',
    ],
    dark: [
      '#121213',
      '#1C1C1D',
      '#404142',
      '#5E5F60',
      '#797A7B',
      '#9C9E9F',
      '#BCBDBE',
      '#D8D9DB',
      '#E4E6E8',
      '#E8EBEE',
    ],
    primary: '#6B6C6D',
  },
  k = Object.fromEntries(
    Object.entries(B)
      .map(([e, t], r, s) => [
        e,
        { light: h({ color: t }), dark: v({ color: t }), primary: t },
      ])
      .concat([['gray', b]]),
  );
function d(e = {}) {
  const t = g.length / 2 + 1,
    r = e.level ?? t;
  let s = F.default(e.color);
  const i = s.toHsv(),
    u = i.h,
    n = i.s,
    o = i.v,
    E = u === 0 && n === 0,
    f = r < t,
    l = Math.abs(t - r),
    C = 1,
    y = 0.1;
  let a = n;
  a > y &&
    (f ? (a = n - ((n - y) / (t - 1)) * l) : (a = n + ((C - n) / (t - 1)) * l)),
    E && (a = n);
  const m = E ? 0.97 : 1,
    D = 0.1;
  let c = o;
  return (
    c > D &&
      (f
        ? (c = o + ((m - o) / (t - 1)) * l)
        : (c = o - ((o - D) / (t - 1)) * l)),
    (s = F.default({ h: u, s: a, v: c })),
    s
  );
}
function p(e = {}) {
  return d(e);
}
function A(e = {}) {
  return d(e).darken(10);
}
function h(e = {}) {
  return g.map((t, r) => p({ ...e, level: r + 1 }));
}
function v(e = {}) {
  return g.map((t, r) => A({ ...e, level: r + 1 })).reverse();
}
function M(e) {
  return F.default(e).toRgbArray().join(',');
}
exports.colorPresets = k;
exports.colors = B;
exports.generate = h;
exports.generateDark = v;
exports.getRgbArrayString = M;
exports.grayPresets = b;
exports.palette = p;
exports.paletteDark = A;
